package com.xnx3.banmahuishou.core.entity;

import static javax.persistence.GenerationType.IDENTITY;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;

import com.xnx3.j2ee.entity.BaseEntity;

/**
 * 行政区划代码字典表
 * @author 王晓龙
 */
@Entity()
@Table(name = "sys_area")
public class Area extends BaseEntity implements java.io.Serializable {
	private Integer id;	//区域主键(行政区划代码)
	private String areaName;	//区域名称（省市区名称）
	private String areaCode;	//区域拼音代码
	private Integer areaParentId;	//上级主键
	
	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "id", unique = true, nullable = false)
	public Integer getId() {
		return id;
	}
	public void setId(Integer id) {
		this.id = id;
	}
	@Column(name = "area_name", columnDefinition="char(20) COLLATE utf8_general_ci COMMENT '区域名称（省市区名称）' default ''")
	public String getAreaName() {
		return areaName;
	}
	public void setAreaName(String areaName) {
		this.areaName = areaName;
	}
	@Column(name = "area_code", columnDefinition="char(128) COLLATE utf8_general_ci COMMENT '区域代码' default ''")
	public String getAreaCode() {
		return areaCode;
	}
	public void setAreaCode(String areaCode) {
		this.areaCode = areaCode;
	}
	@Column(name = "area_parent_id", columnDefinition="int(11) COMMENT '上级主键' default '0'")
	public Integer getAreaParentId() {
		return areaParentId;
	}
	public void setAreaParentId(Integer areaParentId) {
		this.areaParentId = areaParentId;
	}
	
	@Override
	public String toString() {
		return "Area [id=" + id + ", areaName=" + areaName + ", areaCode=" + areaCode + ", areaParentId=" + areaParentId
				+ "]";
	}

}
